-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sdk: add Immutable
and IncorrectAuthority
to ProgramError
#35113
sdk: add Immutable
and IncorrectAuthority
to ProgramError
#35113
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #35113 +/- ##
=========================================
- Coverage 81.6% 81.6% -0.1%
=========================================
Files 830 830
Lines 224955 224963 +8
=========================================
- Hits 183752 183728 -24
- Misses 41203 41235 +32 |
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
This PR introduces the Core BPF implementation of Address Lookup Table. There are a few caveats with the implementation so far. You can find them in the source code by searching for comments prefixed with: ``` [Core BPF]: ``` The following caveats will be solved in the next Solana release, and a discussion can be had for backporting any of these changes: - `InstructionError::Immutable` has no `ProgramError` counterpart ([#35113](solana-labs/solana#35113)). - `InstructionError::IncorrectAuthority` has no `ProgramError` counterpart ([#35113](solana-labs/solana#35113)). - `solana-program-test` will not overwrite a builtin if the BPF program you've provided shares the same address as an existing builtin ([#35233](solana-labs/solana#35233)). The following caveat seems to be unavoidable: - The `build.rs` script and annotations in `lib.rs` are required for `solana-frozen-abi-macro` (See #3). Finally, I've implemented a cooldown period based on `Clock`, but this will likely not be sufficient. I think we should consider merging this initial implementation and leaving #1 unfinished until the proper research is completed.
Problem
Two error variants from
solana_sdk::instruction::InstructionError
are used in the Address Lookup Table's processor. However, as we prepare to port this program to BPF, we will require these error counterparts to exist insolana_program::program_error::ProgramError
.Variants:
InstructionError::Immutable
InstructionError::IncorrectAuthority
Summary of Changes
Add the variants to
solana_program::program_error::ProgramError
.